package g2.routemaster.gui;

import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;

public class GameMenuManager {
   private MenuManager menuManager;
   private MenuManager fileMenu;
   
   public GameMenuManager() {
      this.menuManager = new MenuManager();
   }
   
   public MenuManager getManager() {
      return menuManager;
   }
   
   public void create() {
      addFileMenu();
      addHelpMenu();
   }
   
   void addFileMenu(){
      fileMenu = new MenuManager("&File");

      ActionCollection actions = ActionCollection.instance();
      fileMenu.add(actions.getAddPlayerAction());
      fileMenu.add(new Separator());
      fileMenu.add(actions.getStartGameAction());
      fileMenu.add(actions.getRestartGameAction());
      fileMenu.add(new Separator());
      fileMenu.add(actions.getLoadAction());
      fileMenu.add(actions.getSaveAction());
      
      fileMenu.add(new Separator());
      fileMenu.add(actions.getExitAction());
      
      menuManager.add(fileMenu);
   }
   
   void addHelpMenu(){
      fileMenu = new MenuManager("&Help");

      ActionCollection actions = ActionCollection.instance();
      fileMenu.add(actions.getTestAction());
      fileMenu.add(actions.getTest2Action());
      fileMenu.add(new Separator());
      fileMenu.add(actions.getAboutAction());
      menuManager.add(fileMenu);
   }
}
